home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 43
/
Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso
/
-serious-
/
comms
/
other
/
webtimer
/
webtimer.arexx
next >
Wrap
Text File
|
1999-06-14
|
7KB
|
3 lines
/* Miami Webtimer (Automatischer-Echtzeit-Online-Timer) script $VER: webtimer 2.0a (07.06.1999) Dirk Wenk ©1999
*/
;Datum=date(s);Tag=date(w);Zeit=time(n);T=1*right(Datum,2);MNr=substr(Datum,5,2);J=left(Datum,4);Stunde=left(Zeit,2);Sekunde=right(zeit,1);TSekunde=Right(zeit,2);TNr=find(TageE,Tag);prefs=0;prefs.1=0;Options results;PARSE ARG prefs;say '$VER: webtimer 2.0a (07.06.1999) Dirk Wenk ©1999';if prefs ~=0 then;do;if prefs="f" then;do;IF OPEN('env','ENV:webtimer_g.prefs',R) THEN;do;prefs.1=READLN('env');end;else;do;say " Error - 2 ; can't open file!";exit;end;CLOSE('env');if prefs.1<=12&prefs.1>0 then prefs=prefs.1;else say " Error - 4 ; f="prefs.1" Wrong Argument!";end;if prefs<=12&prefs>0 then prefsenv.2=prefs;if prefs="-config" then call prefsset1;if prefs="?" then;do;call about;say ' webtimer [options]';say ' options: 1 to 12 = means the amount of pf/min. you kan also set it at prefs';say ' options: ? = show this help';say ' options: -config = erase the config file and ask for new setting!';say ' options: f = looks in file env:webtimer_g.prefs for pf/min';say ' ';say ' example: webtimer 5 [means that evry minute costs 5Pf';exit;end;end;IF ~SHOW('LIBRARIES','tritonrexx.library') THEN;DO;IF ~ADDLIB('tritonrexx.library',10,-30,0) THEN;DO;SAY 'Kann die <tritonrexx.library> nicht öffnen!';EXIT(10);END;END;SIGNAL ON break_c;SIGNAL ON failure;SIGNAL ON halt;SIGNAL ON ioerr;SIGNAL ON syntax;IF ~OPEN('env','ENV:webtimer.prefs',R)|prefs='?' THEN;DO;IF OPEN('env','ENV:webtimer.prefs',R) THEN;DO;DO z=1 to 9;defstring.z=READLN('env');END;CLOSE('env');END;ELSE;DO;defstring.1='39.6';defstring.2='5';defstring.3='0';defstring.4='';defstring.5='24';defstring.6='';defstring.7='0';defstring.8='0';defstring.9='0';call prefsset;END;env.1= defstring.1;env.2= defstring.2;env.3= defstring.3;env.4= defstring.4;env.5= defstring.5;env.6= defstring.6;env.7= defstring.7;env.8= defstring.8;env.9= defstring.9;call save;EXIT;END;OPEN('env','ENV:webtimer.prefs',R);DO n=1 to 9;env.n=READLN('env');END;CLOSE('env');if env.1<=0 then call prefsset;if env.2<=0 then call prefsset;if env.5<=0 then call prefsset;if env.6<=env.5&env.5<=T then;do;if env.8=0 then;do;if env.9 ~=0 then;do;DM00=(env.1*100)-env.9;if DM00<0 then address command 'quickreq "Scheiße... in dieser Rechnungsperiode haste 'DM00'DM Mehr ausgegeben!!!" "Mist" -L';if DM00>0 then address command 'quickreq "Huuchuu!!! in dieser Rechnungsperiode haste 'DM00'DM gespart!" "^_^" -L';end;env.7=0;env.9=0;env.8=1;end;end;if env.5 ~=T then env.8=0;env.6=T;pf.0=env.2;if prefsenv.2>0&prefsenv.2<25 then pf.0=prefsenv.2;call calc;apptags='TRCA_Name Webtimer TRCA_LongName "Webtimer für Miami" TRCA_Info "Direckte kostenübersicht und kontrolle!" TRCA_Version "2.0a" TRCA_Release "1" TRCA_Date "7.6.99" TAG_END';windowtags=WindowID(1) WindowTitle('Webtimer') 'vertgroup spaceb HorizGroupE Space' vertgroup TextID(" ",71) 'spaceb' TextN("+/- in DEM:") 'spaceb' TextN('Ges.Kost.:') endgroup vertgroup ClippedTextBoxMW("N/A",81,6) ClippedTextBoxMW("N/A",82,6) ClippedTextBoxMW("N/A",83,6) endgroup 'SpaceB endgroup spaceb EndGroup EndGroup' BeginMenu('Info') MenuItem('A_About',1) ItemBarLabel MenuItem('Q_Quit',9) BeginMenu('Option') MenuItemD('N_Nerv Req. aus?',2) 'EndProject';app=TR_CREATEAPP('TRCA_Name Webtimer');IF app ~="'00000000'x" THEN;DO;window=TR_OPENPROJECT(app,windowtags);IF window ~='00000000'x THEN;do;ende=0;end;else;do;address command 'quickreq "ERROR 1!!!"';CALL exit1;exit;end;end;lst=show('P');if pos('MIAMI',lst)>0 then;do;address miami.1 isonline;result=rc;if rc=5 then;do;if temp2.3<=0 then address command 'run >NIL: quickreq "Zeit ist um!!!" "Shit!" -L';end;end;call calc;timer2=temp.3;tee=0;timer=1;teetime=0;nerv=1;wint=0;call setwin;if pos('MIAMI',lst)>0 then;do;do while timer=1;address miami.1 isonline;result=rc;if rc=0 then;do;timer=0;end;else;do;tee=tee+1;timer2=timer2-1;env.7=env.7+1;env.9=env.9+pf.0;call calc;call setwin;if teetime>=2&temp2.3<0 then;do;address command 'run >nil: quickreq "Zeit um 'timer2' Minuten Überzogen" "ja ja..." -L';teetime=0;end;else;do;teetime=teetime+1;end;env.3=timer2;CALL save;address command 'wait 59';if TR_HANDLEMSG(app,'event') then;do;IF event.trm_class='TRMS_CLOSEWINDOW' THEN;do;call save;call exit1;exit;end;IF event.trm_class='TRMS_ACTION' THEN;DO;if event.trm_id=9 THEN;DO;call save;call exit1;exit;end;IF event.trm_id=1 THEN;call about;end;IF event.trm_class='TRMS_NEWVALUE' THEN;DO;SELECT;WHEN event.trm_id=2 THEN;DO;IF event.trm_data=0 THEN;nerv=1;ELSE;nerv=0;end;end;end;end;end;end;end;else;do;address command 'quickreq "Erst Miami starten!" "Ups..." -L';end;env.3=timer2;tagtimer.2=tagtimer-tagtimer-tagtimer;if temp.3<0 then address command 'quickreq "Du hast um 'tagtimer.2' Tage Überzogen!" "ARGH" -L';if temp.3>=1 then address command 'quickreq "Wow!!! 'temp.3' Minute(n) Übrig!!!" "Wow C00l!" -L';CALL save;CALL exit1;EXIT(0);exit;exit1:;CALL TR_CLOSEPROJECT(window);CALL TR_DELETEAPP(app);return;calc:;temp.1=env.1*100;temp.2=temp.1/30;temp.01=temp.1-env.9;temp.02=temp.01/temp.2;if T>=env.5 then;do;temp.001=T-env.5-30;temp2.1=temp.02+temp.001+1;end;if T<env.5 then;do;temp.001=T+(30-env.5);temp2.1=temp.02-temp.001;end;temp2.3=temp2.1*temp.2;temp2.4=temp2.3/100;temp.3=temp2.3/pf.0;return;setwin:;if prefsenv.2>0&prefsenv.2<=25&wint=1 then;do;CALL TR_SETATTRIBUTE(window,0,'TRWI_Title','Web 'prefsenv.2'pf/min');wint=0;end;else;do;CALL TR_SETATTRIBUTE(window,0,'TRWI_Title','Webtimer V2a');wint=1;end;if temp2.1<=0 then;do;tagtimer=temp2.1;CALL TR_SETATTRIBUTE(window,71,'TRAT_Text',"Übz. Tage:");end;else;do;tagtimer=temp.3;CALL TR_SETATTRIBUTE(window,71,'TRAT_Text',"+Zeit/heute:");end;CALL TR_SETATTRIBUTE(window,81,'TRAT_Text',tagtimer);CALL TR_SETATTRIBUTE(window,82,'TRAT_Text',temp2.4);kosten1=env.9/100;CALL TR_SETATTRIBUTE(window,83,'TRAT_Text',kosten1);return;about:;address command 'run >NIL: quickreq "About\\Webtimer V2.0a\Der Echtzeit Online\ Gebühren-Manager!\\Geschrieben von\Dirk Wenk\E-Mail: Wax@topmail.de\\!!-Unregistriert-!!" "OK" -C';return;prefsmenu:;address command "cls";say " ";say "----------------------Config Menü----------------------";say "";say " 1. Maximale Internet Rechnug: " env.1"DM";say " 2. Pfennige pro Minute (default:5): " env.2"pf/min";say " 3. Tag der neuabrechnung (def:24) : " env.5".";say " Q = Save & exit";say " ";say " ";return;prefsset1:;do n=1 to 9;env.n=0;end;call prefsset;return;prefsset:;call prefsmenu;menu=0;Do while menu ~="Q";say " > Wähle:";pull menu;if menu=1 then call menu1;if menu=2 then call menu2;if menu=3 then call menu3;if menu>3&menu<1 then;do;call prefsmenu;call prefsset;end;if menu="Q" then;do;call save;exit;end;end;return;menu1:;say " Wieviel DM pro monat möchtest du ausgeben?";pull env.1;menu=0;call prefsmenu;return;menu2:;say " Wieviel pfennige pro minute kostet ihr internetzugang?";pull env.2;menu=0;call prefsmenu;return;menu3:;say " Wann soll der monat neu abgerechnet werden?";pull env.5;menu=0;call prefsmenu;return;return;save:;OPEN('env','ENV:webtimer.prefs',W);DO n=1 to 9;WRITELN('env',env.n);END;CLOSE('env');ADDRESS COMMAND 'COPY ENV:webtimer.prefs ENVARC:webtimer.prefs.bak';ADDRESS COMMAND 'run >NIL: COPY ENVARC:webtimer.prefs.bak ENVARC:webtimer.prefs';return;break_c:;failure:;halt:;ioerr:;syntax:;SAY '+++ Fehler' rc 'in Zeile' sigl '-' ERRORTEXT(rc);IF app ~='00000000'x THEN;CALL TR_DELETEAPP(app);EXIT(10)